import com.troyworks.framework.ui.MCInitObject;
/**
 * @author Troy Gardner
 */
class com.troyworks.framework.ui.LayoutAnchor extends MovieClip {
	public var iAmAPlaceholder:Boolean = true;
	public var depth2:Number;
	public var id:Number;
	public var isStart:Boolean = false;
	public function LayoutAnchor() {
		super();
	}
	public function onLoad():Void{
	
		_visible = false;
		setDepth();
	}
	public function setDepth():Number{
				var a:Number = String(this._name).indexOf("ph");
		var b:Number = String(this._name).indexOf("_");
		var endS:String = String(String(this._name).substr(b+1, this._name.length-1)).toLowerCase();
		if(endS == "start"){
			isStart = true;
		}
	
		id = parseInt(String(this._name).substring(a+2, a+2+b));
		depth2 = id + 24;
		trace(id + " LayoutAnchor depth2:" +depth2 + " '" + endS + "'");
		return depth2;
	}
	public function getXYPosition():MCInitObject{
		var p:MCInitObject = new MCInitObject();
		p._x = _x;
		p._y = _y;
		return p;
	}
	public function getXYWHPosition():MCInitObject{
		var p:MCInitObject = new MCInitObject();
		p._x = _x;
		p._y = _y;
		p._width = _width;
		p._height = _height;
		return p;
	}
	public function toString():String{
		return "LayoutAnchor " + _name + " @ " + depth2; 
	}
	
}